package com.wutianyi.thrift.socket;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketS {
	public static void main(String[] args) {
		try {
			ServerSocket server  = new ServerSocket(9090);
			while(true) {
				Socket s = server.accept();
				InputStream input = s.getInputStream();
				int i = 0;
				byte[] b = new byte[1024];
				while((i = input.read(b)) != -1) {
					System.out.println(new String(b));
				}
				input.close();
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
}
